<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>

    </style>
</head>

<body>
    <p name="text" class="one"> hello world</p>
    <script>
        // 通过name 获得的是 nodelist 这是节点的集合
        /* id是直接获取的元素
         
        quertSelector 通过选择器获取 nodelist
        
        */
       /* 
        id 直接获取元素
        class HTMLcollection html 集合
        tagName nodelist
        querySelector 通过选择器获取 nodelist
        通过name nodelist 节点的集合
       */
        var one = document.querySelectorAll('.one');
        var p = document.getElementsByTagName('p');
        var test = document.getElementsByName('test');
        console.log(p);
        console.log(test);
        console.log(one);
    </script>
</body>

</html>